package com.heo.pojo;

import com.heo.util.ByteHelper;

public class AttributeInfoEntity  extends BaseEntity{

	private static final long serialVersionUID = 1L;
	
	private String type;
	private String factoryId;//制造商 ID
	private String terminalModel;
	private String bluetooth; //
	private String bluetoothVersion;
	private String iccid;//终端 SIM 卡 ICCID
	private String hardwareVersion;//终端硬件版本号
	private String firmwareVersion;//终端固件版本号
	
	public AttributeInfoEntity(String bodyHex) {
		type = bodyHex.substring(0, 4);
		factoryId = bodyHex.substring(4, 14);
		terminalModel = bodyHex.substring(14, 54);
		bluetooth = bodyHex.substring(54, 66);
		bluetoothVersion = bodyHex.substring(66, 68);
		iccid = bodyHex.substring(68, 88);
		int hardwareLength = ByteHelper.hex16ToInt(bodyHex.substring(88, 90));
		int length = 90 + hardwareLength * 2;
		hardwareVersion = bodyHex.substring(90, length);
		int firmwareLength = ByteHelper.hex16ToInt(bodyHex.substring(length, length + 2));
		firmwareVersion = bodyHex.substring(length + 2, length + firmwareLength * 2 + 2);
	}
	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getFactoryId() {
		return factoryId;
	}
	public void setFactoryId(String factoryId) {
		this.factoryId = factoryId;
	}
	public String getTerminalModel() {
		return terminalModel;
	}

	public void setTerminalModel(String terminalModel) {
		this.terminalModel = terminalModel;
	}

	public String getBluetooth() {
		return bluetooth;
	}
	public void setBluetooth(String bluetooth) {
		this.bluetooth = bluetooth;
	}
	public String getIccid() {
		return iccid;
	}
	public void setIccid(String iccid) {
		this.iccid = iccid;
	}
	public String getHardwareVersion() {
		return hardwareVersion;
	}
	public void setHardwareVersion(String hardwareVersion) {
		this.hardwareVersion = hardwareVersion;
	}
	public String getFirmwareVersion() {
		return firmwareVersion;
	}
	public void setFirmwareVersion(String firmwareVersion) {
		this.firmwareVersion = firmwareVersion;
	}

	public String getBluetoothVersion() {
		return bluetoothVersion;
	}

	public void setBluetoothVersion(String bluetoothVersion) {
		this.bluetoothVersion = bluetoothVersion;
	}
}
